#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    queue<int> Q;
    while (n--) {
        int t;
        cin >> t;
        Q.push(t);
    }
    while (Q.size()) {
        int x = Q.front();
        Q.pop();
        cout << x << " ";
        if (Q.empty())break;
        x = Q.front();
        Q.pop();
        Q.push(x);
    }

    return 0;
}